3.35 \(\int \frac{d+\frac{e}{x}}{c+\frac{a}{x^2}+\frac{b}{x}} \, dx\)

Optimal. Leaf size=86 \[ -\frac{\left (-2 a c d+b^2 d-b c e\right ) \tanh ^{-1}\left (\frac{b+2 c x}{\sqrt{b^2-4 a c}}\right )}{c^2 \sqrt{b^2-4 a c}}-\frac{(b d-c e) \log \left (a+b x+c x^2\right )}{2 c^2}+\frac{d x}{c} \]

[Out]

(d*x)/c - ((b^2*d - 2*a*c*d - b*c*e)*ArcTanh[(b + 2*c*x)/Sqrt[b^2 - 4*a*c]])/(c^2*Sqrt[b^2 - 4*a*c]) - ((b*d -
 c*e)*Log[a + b*x + c*x^2])/(2*c^2)

________________________________________________________________________________________

Rubi [A]  time = 0.0812762, antiderivative size = 86, normalized size of antiderivative = 1., number of steps used = 6, number of rules used = 6, integrand size = 22, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.273, Rules used = {1393, 773, 634, 618, 206, 628} \[ -\frac{\left (-2 a c d+b^2 d-b c e\right ) \tanh ^{-1}\left (\frac{b+2 c x}{\sqrt{b^2-4 a c}}\right )}{c^2 \sqrt{b^2-4 a c}}-\frac{(b d-c e) \log \left (a+b x+c x^2\right )}{2 c^2}+\frac{d x}{c} \]

Antiderivative was successfully verified.

[In]

Int[(d + e/x)/(c + a/x^2 + b/x),x]

[Out]

(d*x)/c - ((b^2*d - 2*a*c*d - b*c*e)*ArcTanh[(b + 2*c*x)/Sqrt[b^2 - 4*a*c]])/(c^2*Sqrt[b^2 - 4*a*c]) - ((b*d -
 c*e)*Log[a + b*x + c*x^2])/(2*c^2)

Rule 1393

Int[((a_) + (c_.)*(x_)^(n2_.) + (b_.)*(x_)^(n_))^(p_.)*((d_) + (e_.)*(x_)^(n_))^(q_.), x_Symbol] :> Int[x^(n*(
2*p + q))*(e + d/x^n)^q*(c + b/x^n + a/x^(2*n))^p, x] /; FreeQ[{a, b, c, d, e, n}, x] && EqQ[n2, 2*n] && Integ
ersQ[p, q] && NegQ[n]

Rule 773

Int[(((d_.) + (e_.)*(x_))*((f_) + (g_.)*(x_)))/((a_.) + (b_.)*(x_) + (c_.)*(x_)^2), x_Symbol] :> Simp[(e*g*x)/
c, x] + Dist[1/c, Int[(c*d*f - a*e*g + (c*e*f + c*d*g - b*e*g)*x)/(a + b*x + c*x^2), x], x] /; FreeQ[{a, b, c,
 d, e, f, g}, x] && NeQ[b^2 - 4*a*c, 0]

Rule 634

Int[((d_.) + (e_.)*(x_))/((a_) + (b_.)*(x_) + (c_.)*(x_)^2), x_Symbol] :> Dist[(2*c*d - b*e)/(2*c), Int[1/(a +
 b*x + c*x^2), x], x] + Dist[e/(2*c), Int[(b + 2*c*x)/(a + b*x + c*x^2), x], x] /; FreeQ[{a, b, c, d, e}, x] &
& NeQ[2*c*d - b*e, 0] && NeQ[b^2 - 4*a*c, 0] &&  !NiceSqrtQ[b^2 - 4*a*c]

Rule 618

Int[((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(-1), x_Symbol] :> Dist[-2, Subst[Int[1/Simp[b^2 - 4*a*c - x^2, x], x]
, x, b + 2*c*x], x] /; FreeQ[{a, b, c}, x] && NeQ[b^2 - 4*a*c, 0]

Rule 206

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1*ArcTanh[(Rt[-b, 2]*x)/Rt[a, 2]])/(Rt[a, 2]*Rt[-b, 2]), x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rule 628

Int[((d_) + (e_.)*(x_))/((a_.) + (b_.)*(x_) + (c_.)*(x_)^2), x_Symbol] :> Simp[(d*Log[RemoveContent[a + b*x +
c*x^2, x]])/b, x] /; FreeQ[{a, b, c, d, e}, x] && EqQ[2*c*d - b*e, 0]

Rubi steps

\begin{align*} \int \frac{d+\frac{e}{x}}{c+\frac{a}{x^2}+\frac{b}{x}} \, dx &=\int \frac{x (e+d x)}{a+b x+c x^2} \, dx\\ &=\frac{d x}{c}+\frac{\int \frac{-a d+(-b d+c e) x}{a+b x+c x^2} \, dx}{c}\\ &=\frac{d x}{c}-\frac{(b d-c e) \int \frac{b+2 c x}{a+b x+c x^2} \, dx}{2 c^2}+\frac{\left (b^2 d-2 a c d-b c e\right ) \int \frac{1}{a+b x+c x^2} \, dx}{2 c^2}\\ &=\frac{d x}{c}-\frac{(b d-c e) \log \left (a+b x+c x^2\right )}{2 c^2}-\frac{\left (b^2 d-2 a c d-b c e\right ) \operatorname{Subst}\left (\int \frac{1}{b^2-4 a c-x^2} \, dx,x,b+2 c x\right )}{c^2}\\ &=\frac{d x}{c}-\frac{\left (b^2 d-2 a c d-b c e\right ) \tanh ^{-1}\left (\frac{b+2 c x}{\sqrt{b^2-4 a c}}\right )}{c^2 \sqrt{b^2-4 a c}}-\frac{(b d-c e) \log \left (a+b x+c x^2\right )}{2 c^2}\\ \end{align*}

Mathematica [A]  time = 0.0898583, size = 86, normalized size = 1. \[ \frac{\frac{2 \left (-2 a c d+b^2 d-b c e\right ) \tan ^{-1}\left (\frac{b+2 c x}{\sqrt{4 a c-b^2}}\right )}{\sqrt{4 a c-b^2}}+(c e-b d) \log (a+x (b+c x))+2 c d x}{2 c^2} \]

Antiderivative was successfully verified.

[In]

Integrate[(d + e/x)/(c + a/x^2 + b/x),x]

[Out]

(2*c*d*x + (2*(b^2*d - 2*a*c*d - b*c*e)*ArcTan[(b + 2*c*x)/Sqrt[-b^2 + 4*a*c]])/Sqrt[-b^2 + 4*a*c] + (-(b*d) +
 c*e)*Log[a + x*(b + c*x)])/(2*c^2)

________________________________________________________________________________________

Maple [A]  time = 0.003, size = 161, normalized size = 1.9 \begin{align*}{\frac{dx}{c}}-{\frac{\ln \left ( c{x}^{2}+bx+a \right ) bd}{2\,{c}^{2}}}+{\frac{\ln \left ( c{x}^{2}+bx+a \right ) e}{2\,c}}-2\,{\frac{ad}{c\sqrt{4\,ac-{b}^{2}}}\arctan \left ({\frac{2\,cx+b}{\sqrt{4\,ac-{b}^{2}}}} \right ) }+{\frac{{b}^{2}d}{{c}^{2}}\arctan \left ({(2\,cx+b){\frac{1}{\sqrt{4\,ac-{b}^{2}}}}} \right ){\frac{1}{\sqrt{4\,ac-{b}^{2}}}}}-{\frac{be}{c}\arctan \left ({(2\,cx+b){\frac{1}{\sqrt{4\,ac-{b}^{2}}}}} \right ){\frac{1}{\sqrt{4\,ac-{b}^{2}}}}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((d+e/x)/(c+a/x^2+b/x),x)

[Out]

d*x/c-1/2/c^2*ln(c*x^2+b*x+a)*b*d+1/2/c*ln(c*x^2+b*x+a)*e-2/c/(4*a*c-b^2)^(1/2)*arctan((2*c*x+b)/(4*a*c-b^2)^(
1/2))*a*d+1/c^2/(4*a*c-b^2)^(1/2)*arctan((2*c*x+b)/(4*a*c-b^2)^(1/2))*b^2*d-1/c/(4*a*c-b^2)^(1/2)*arctan((2*c*
x+b)/(4*a*c-b^2)^(1/2))*b*e

________________________________________________________________________________________

Maxima [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d+e/x)/(c+a/x^2+b/x),x, algorithm="maxima")

[Out]

Exception raised: ValueError

________________________________________________________________________________________

Fricas [A]  time = 1.29934, size = 643, normalized size = 7.48 \begin{align*} \left [\frac{2 \,{\left (b^{2} c - 4 \, a c^{2}\right )} d x +{\left (b c e -{\left (b^{2} - 2 \, a c\right )} d\right )} \sqrt{b^{2} - 4 \, a c} \log \left (\frac{2 \, c^{2} x^{2} + 2 \, b c x + b^{2} - 2 \, a c + \sqrt{b^{2} - 4 \, a c}{\left (2 \, c x + b\right )}}{c x^{2} + b x + a}\right ) -{\left ({\left (b^{3} - 4 \, a b c\right )} d -{\left (b^{2} c - 4 \, a c^{2}\right )} e\right )} \log \left (c x^{2} + b x + a\right )}{2 \,{\left (b^{2} c^{2} - 4 \, a c^{3}\right )}}, \frac{2 \,{\left (b^{2} c - 4 \, a c^{2}\right )} d x + 2 \,{\left (b c e -{\left (b^{2} - 2 \, a c\right )} d\right )} \sqrt{-b^{2} + 4 \, a c} \arctan \left (-\frac{\sqrt{-b^{2} + 4 \, a c}{\left (2 \, c x + b\right )}}{b^{2} - 4 \, a c}\right ) -{\left ({\left (b^{3} - 4 \, a b c\right )} d -{\left (b^{2} c - 4 \, a c^{2}\right )} e\right )} \log \left (c x^{2} + b x + a\right )}{2 \,{\left (b^{2} c^{2} - 4 \, a c^{3}\right )}}\right ] \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d+e/x)/(c+a/x^2+b/x),x, algorithm="fricas")

[Out]

[1/2*(2*(b^2*c - 4*a*c^2)*d*x + (b*c*e - (b^2 - 2*a*c)*d)*sqrt(b^2 - 4*a*c)*log((2*c^2*x^2 + 2*b*c*x + b^2 - 2
*a*c + sqrt(b^2 - 4*a*c)*(2*c*x + b))/(c*x^2 + b*x + a)) - ((b^3 - 4*a*b*c)*d - (b^2*c - 4*a*c^2)*e)*log(c*x^2
 + b*x + a))/(b^2*c^2 - 4*a*c^3), 1/2*(2*(b^2*c - 4*a*c^2)*d*x + 2*(b*c*e - (b^2 - 2*a*c)*d)*sqrt(-b^2 + 4*a*c
)*arctan(-sqrt(-b^2 + 4*a*c)*(2*c*x + b)/(b^2 - 4*a*c)) - ((b^3 - 4*a*b*c)*d - (b^2*c - 4*a*c^2)*e)*log(c*x^2
+ b*x + a))/(b^2*c^2 - 4*a*c^3)]

________________________________________________________________________________________

Sympy [B]  time = 1.26763, size = 423, normalized size = 4.92 \begin{align*} \left (- \frac{\sqrt{- 4 a c + b^{2}} \left (2 a c d - b^{2} d + b c e\right )}{2 c^{2} \left (4 a c - b^{2}\right )} - \frac{b d - c e}{2 c^{2}}\right ) \log{\left (x + \frac{- a b d - 4 a c^{2} \left (- \frac{\sqrt{- 4 a c + b^{2}} \left (2 a c d - b^{2} d + b c e\right )}{2 c^{2} \left (4 a c - b^{2}\right )} - \frac{b d - c e}{2 c^{2}}\right ) + 2 a c e + b^{2} c \left (- \frac{\sqrt{- 4 a c + b^{2}} \left (2 a c d - b^{2} d + b c e\right )}{2 c^{2} \left (4 a c - b^{2}\right )} - \frac{b d - c e}{2 c^{2}}\right )}{2 a c d - b^{2} d + b c e} \right )} + \left (\frac{\sqrt{- 4 a c + b^{2}} \left (2 a c d - b^{2} d + b c e\right )}{2 c^{2} \left (4 a c - b^{2}\right )} - \frac{b d - c e}{2 c^{2}}\right ) \log{\left (x + \frac{- a b d - 4 a c^{2} \left (\frac{\sqrt{- 4 a c + b^{2}} \left (2 a c d - b^{2} d + b c e\right )}{2 c^{2} \left (4 a c - b^{2}\right )} - \frac{b d - c e}{2 c^{2}}\right ) + 2 a c e + b^{2} c \left (\frac{\sqrt{- 4 a c + b^{2}} \left (2 a c d - b^{2} d + b c e\right )}{2 c^{2} \left (4 a c - b^{2}\right )} - \frac{b d - c e}{2 c^{2}}\right )}{2 a c d - b^{2} d + b c e} \right )} + \frac{d x}{c} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d+e/x)/(c+a/x**2+b/x),x)

[Out]

(-sqrt(-4*a*c + b**2)*(2*a*c*d - b**2*d + b*c*e)/(2*c**2*(4*a*c - b**2)) - (b*d - c*e)/(2*c**2))*log(x + (-a*b
*d - 4*a*c**2*(-sqrt(-4*a*c + b**2)*(2*a*c*d - b**2*d + b*c*e)/(2*c**2*(4*a*c - b**2)) - (b*d - c*e)/(2*c**2))
 + 2*a*c*e + b**2*c*(-sqrt(-4*a*c + b**2)*(2*a*c*d - b**2*d + b*c*e)/(2*c**2*(4*a*c - b**2)) - (b*d - c*e)/(2*
c**2)))/(2*a*c*d - b**2*d + b*c*e)) + (sqrt(-4*a*c + b**2)*(2*a*c*d - b**2*d + b*c*e)/(2*c**2*(4*a*c - b**2))
- (b*d - c*e)/(2*c**2))*log(x + (-a*b*d - 4*a*c**2*(sqrt(-4*a*c + b**2)*(2*a*c*d - b**2*d + b*c*e)/(2*c**2*(4*
a*c - b**2)) - (b*d - c*e)/(2*c**2)) + 2*a*c*e + b**2*c*(sqrt(-4*a*c + b**2)*(2*a*c*d - b**2*d + b*c*e)/(2*c**
2*(4*a*c - b**2)) - (b*d - c*e)/(2*c**2)))/(2*a*c*d - b**2*d + b*c*e)) + d*x/c

________________________________________________________________________________________

Giac [A]  time = 1.10065, size = 115, normalized size = 1.34 \begin{align*} \frac{d x}{c} - \frac{{\left (b d - c e\right )} \log \left (c x^{2} + b x + a\right )}{2 \, c^{2}} + \frac{{\left (b^{2} d - 2 \, a c d - b c e\right )} \arctan \left (\frac{2 \, c x + b}{\sqrt{-b^{2} + 4 \, a c}}\right )}{\sqrt{-b^{2} + 4 \, a c} c^{2}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d+e/x)/(c+a/x^2+b/x),x, algorithm="giac")

[Out]

d*x/c - 1/2*(b*d - c*e)*log(c*x^2 + b*x + a)/c^2 + (b^2*d - 2*a*c*d - b*c*e)*arctan((2*c*x + b)/sqrt(-b^2 + 4*
a*c))/(sqrt(-b^2 + 4*a*c)*c^2)